package com.itbird.eventbus.core;

import com.itbird.eventbus.annotation.ThreadMode;

import java.lang.reflect.Method;

/**
 * SubscribeMethod用于定义被subscribe修饰的方法封装
 * Created by itbird on 2022/9/19
 */
public class SubscribeMethod<T> {
    final Method method;
    final ThreadMode threadMode;
    T t;

    public SubscribeMethod(T t, Method method, ThreadMode threadMode) {
        this.threadMode = threadMode;
        this.method = method;
        this.t = t;
    }

    public Method getMethod() {
        return method;
    }

    public T getObject() {
        return t;
    }

    public ThreadMode getThreadMode() {
        return threadMode;
    }

    @Override
    public String toString() {
        return "SubscribeMethod{" +
                "method=" + method +
                ", threadMode=" + threadMode +
                ", t=" + t +
                '}';
    }
}
